<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="a">a</div>

<script>
  var a = document.getElementById('a');
  console.log(a);  // => <div id="a">a</div>
  console.dir(a);  // => div#a
</script>
</body>
</html>